/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86155
 * date: 2024-03-09
 * Time: 16:29
 *
 * @author 内部类
 */
class Inner{
    private int date1 =1;
    private int date2 = 2;
    private static int date3 = 3;

    public void setAge(){
        Innere inse = new Innere();
        inse.func();
        System.out.println("外部类！");
    }


    //实例内部类
    class Innere{
        public int date1 = 111;
        public int date4 = 4;
        int date5 = 5;
        //public static int date6; //error
        public static final int date7 = 6;//直接定义成常量程序加载时就确定了
        public void func(){
            System.out.println("Innere:func");
            System.out.println(date1);
            System.out.println(Inner.this.date1);//1
            //2
            Inner a = new Inner();
            System.out.println(a.date1);


            System.out.println(date2);
            System.out.println(date3);
            System.out.println(date4);
            System.out.println(date5);
            System.out.println(date7);

        }
    }


}
public class Test {
    public static void main(String[] args) {
        Inner inner = new Inner();
        Inner.Innere inn = inner.new Innere();//内部类引用的方法一
        Inner.Innere inn1 = new Inner().new Innere();//内部类引用的方法二
        inner.setAge();
    }



}
